﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Data.SqlClient;
using System.Data;

namespace BLL
{
    public class AnalysisFinace
    {
        /*财务类型统计报表*/
        public DataTable AnalyzeFinaceType(int parentTypeID,int memberID,DateTime beginTime,DateTime endTime)
        {
            string procName = "AnalyzeFinaceType";

            SqlCommand cmd = new SqlCommand(procName);
            cmd.CommandType = CommandType.StoredProcedure;
           
            SqlParameter par = new SqlParameter("@ParentTypeID", parentTypeID);
            cmd.Parameters.Add(par);

            par = new SqlParameter("@MemberID", memberID);
            cmd.Parameters.Add(par);

            par = new SqlParameter("@BeginTime", beginTime);
            cmd.Parameters.Add(par);

            par = new SqlParameter("@EndTime", endTime);
            cmd.Parameters.Add(par);

            using (SqlConnection cn = new SqlConnection(DB.ConStr))
            {
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                cmd.Connection = cn;
              
                DataSet ds = new DataSet();
                da.Fill(ds);

                return ds.Tables[0];
            }
        }

    }
}
